package com.badibadi.adapter;

import java.util.List;

import com.badibadi.infos.ClueTypeModel;
import com.badibadi.mytools.DisplayUtil;
import com.badibadi.mytools.ViewHolder;
import com.badibadi.uniclubber.R;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

public class AlbumAdapter extends BaseAdapter {
	private List<ClueTypeModel> models;
	private Context context;

	public AlbumAdapter(List<ClueTypeModel> models, Context context) {
		this.models = models;
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return models.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return models.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View convertView, ViewGroup arg2) {
		if (convertView == null) {
			convertView = ViewHolder.buildView(context,
					R.layout.spinner_item_main, arg2);
		}
		ViewHolder viewHolder = (ViewHolder) convertView.getTag();
		TextView name = viewHolder.getViewById(R.id.spinner_item_name);
		name.setText(models.get(arg0).getName());
		name.setTextColor(R.color.black);
		return convertView;
	}
}
